package ac.github.os.internal.core.action.location.particle

import ac.github.os.internal.core.config.StringConfig
import ac.github.os.internal.core.config.get
import ac.github.os.internal.session.Cache
import ac.github.os.internal.session.Session
import taboolib.common.platform.Awake
import taboolib.common5.Coerce
import taboolib.module.effect.Arc
import taboolib.module.effect.Astroid

@Awake
class AstroidParticle : IParticleAction() {
    override val particleName: String
        get() = "astroid"

    override fun onExecute(session: Session, cache: Cache, config: StringConfig) {
        val radius = config.radius()
        val spawner = config.spawner()
        cache.filterIsEntities().forEach {
            Astroid(radius, it.location.adapt(), spawner).inject(config).show()
        }
    }
}